package com.myself.cloud.service.controller;

import com.myself.cloud.api.IMyselfUserService;
import com.myself.cloud.entity.ResultEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 前端控制器
 *
 * @author baijialiang
 * @since 2022-09-01
 */

@RestController
@Api(value = "", tags = "")
@RequestMapping("/oauth")
public class OauthController {
    @Autowired
    private IMyselfUserService myselfUserService;

    @PostMapping("/getDetails")
    @ApiOperation(value = "获取认证对象", notes = "getDetails")
    public ResultEntity list() {
        Object details =
                SecurityContextHolder.getContext().getAuthentication().getDetails();
        return ResultEntity.success(details);
    }
}
